

function initData(){
	 $.post("/resource/getResource",function(res){
		 if(res.code=='0'){
			 var data = res.data;
			for(var i=0;i<data.length;i++){
				if(data[i].type==1){
					$("#starts")
					var div ='<div class="col-md-3 service-grid-agileits service-grid-agileits-top">';
					div +='<img alt="" src="'+data[i].imgUrl+'" height="205px" width="260px" /><div>&nbsp;</div>';
//					div +='<img alt="" src="images/cai.jpg"><div>&nbsp;</div>';
					div +='<h4>'+data[i].name+'</h4>'
					div +='<p>'+data[i].remark+'</p><a href="news.html">了解更多</a></div>';
					$("#starts").append(div);
				}else if(data[i].type==2){
					var div = '<li><div class="trend-grid">';
					div+='<img src="'+data[i].imgUrl+'"  class="img-responsive"/>';
					div+='</div></li>';
					$("#flexiselDemo1").append(div);
				}else if(data[i].type==3){
					var div='<div class="col-md-3 new-grid-w3l view view-eighth">';
					div+='<img src="'+data[i].imgUrl+'" height="235px" width="310px" />';
					div+='<div class="mask"><a href="javascript:(0);"><h4>'+data[i].name+'</h4></a>';
					div+='<p>'+data[i].remark+'</p></div></div>';
					$("#mproduct").append(div);
				}else if(data[i].type==4){
					var div = '<li><img src="'+data[i].imgUrl+'" /></li>';
					$("#slider").append(div);
				}else if(data[i].type==5){
					var div = '<h3>'+data[i].name+'</h3>';
					div+='<p>'+data[i].remark+'</p>';
					div+='<a href="javascript:(0);" class="learn">了解更多</a>';
					$("#undertext").append(div);
				}else{
					
				}
			}
			$("#starts").append('<div class="clearfix"></div>');
			$("#mproduct").append('<div class="clearfix"></div>');
			$("#flexiselDemo1").flexisel({
				visibleItems: 4,
				animationSpeed: 1000,
				autoPlay: true,
				autoPlaySpeed: 3000,    		
				pauseOnHover: true,
				enableResponsiveBreakpoints: true,
				responsiveBreakpoints: { 
					portrait: { 
						changePoint:480,
						visibleItems: 2
					}, 
					landscape: { 
						changePoint:640,
						visibleItems:3
					},
					tablet: { 
						changePoint:768,
						visibleItems: 4
					}
				}
			});
			$(function () {
				$("#slider").responsiveSlides({
					auto: true,
					nav: true,
					speed: 800,
					namespace: "callbacks",
					pager: true,
				});
			});
		 }else{
			 alert(res.msg);
		 }
	    },'json');
	
}

